Skip to content

Add annulus stats with robust sigma clipping#173

Open
karpov-sv wants to merge 3 commits intosep-developers:mainfrom
karpov-sv:stats
Open

Add annulus stats with robust sigma clipping#173
karpov-sv wants to merge 3 commits intosep-developers:mainfrom
karpov-sv:stats

Conversation

@karpov-sv
Copy link

@karpov-sv karpov-sv commented Feb 2, 2026

Annulus stats with robust sigma clipping, suitable e.g. for better local background estimation in crowded cases:

  • Added sep.stats_circann to compute annulus statistics (mean, std, median, mad_std, sigma‑clipped mean, and area) with the same mask/segmap semantics as existing aperture routines.
  • Sigma‑clipping uses median/MAD (scaled by 1.4826, so like mad_std) and exposes clip_sigma/clip_iters for configuration.

Also, a couple of minor fixes:

  • Avoid divide‑by‑zero when subpix == 0 by only computing scale/offset when subpix > 0 (src/aperture.i).
  • When mask covers the full aperture, return zeros and set SEP_APER_ALLMASKED instead of dividing by zero (src/aperture.i).
  • sum_circann docstring now matches the signature order (var, err) (sep.pyx).

Compute annulus area and sumerr in one pass.
Update the C API and Python wrapper.
Document the new outputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant